<?php

include("header.php");

	print("
		<title>DoD Block Exploits</title>
		
		<table align=\"center\" cellpadding=\"4\" cellspacing=\"0\" rules=\"rows\">
		<tr height=\"25px\">
		<td align=\"center\" style=\"background: #20578d\">Time</td>
		<td align=\"center\" style=\"background: #20578d\">Name</td>
		<td align=\"center\" style=\"background: #20578d\">Steam ID</td>
		<td align=\"center\" style=\"background: #20578d\">Exploit</td>
		</tr>
		");

	$plrData = array();

	//$query = "select id,player_steam,player_ip,player_name,exploit_name,time from ".$tbl_logged." WHERE (exploit_name<>'Respawn Timer Bypass') AND (exploit_name<>'Undeployed MG-Reload') order by id desc limit ".$display_limit."";
	$query = "select id,player_steam,player_ip,player_name,exploit_name,time from ".$tbl_logged." WHERE (exploit_action='Banned') order by id desc limit ".$display_limit."";
	$result = mysql_query($query);
	
	if($result)
		$num_results = mysql_num_rows($result);
	else
		$num_results = 0;
		
		if($num_results<1)
			{
			print("
				<tr class=\"row0\" onMouseOver=\"this.className='rowhover'\" onMouseOut=\"this.className='row0'\">
				<td colspan=\"4\" class=\"customtd1\" align=\"center\">No Detections Logged</td>
				</tr>
			</tr>");
			}
		else
			{

        for($i=0;$row = mysql_fetch_array($result);$i++)
			{
               for($j=0;$j<6;$j++)
					$plrData[$i][$j] = $row[$j];
			}
        
        $rowclass = 0;
        for($i=0;$plrData[$i][0]!=null;$i++)
				{
				$diff=$time_diff * 3600;
				$logtime=date("m-d-Y",strtotime($plrData[$i][5]) + $diff);

				print("			
					<tr class=\"row".$rowclass."\" onMouseOver=\"this.className='rowhover'\" onMouseOut=\"this.className='row".$rowclass."'\" onClick=\"document.location='view_details.php?id=".$plrData[$i][0]."'\">
						<td class=\"customtd1\" align=\"center\">".$logtime."</td>
						<td class=\"customtd1\" align=\"center\">".$plrData[$i][3]."</td>
						<td class=\"customtd1\" align=\"center\">".$plrData[$i][1]."</td>
						<td class=\"customtd1\" align=\"center\">".$plrData[$i][4]."</td>
					</tr>");
				 
				 $rowclass = 1 - $rowclass;	 
				}
			}
			
	$query = "SELECT COUNT(id) AS 'total' FROM ".$tbl_logged."";
	$result = mysql_query($query);
        
	if($result)
		$detectCount = mysql_fetch_array($result);
	else
		$detectCount['total'] = 0;
	
	if($num_results)
		{
		print("
			<tr>
			<td align=\"center\" colspan=\"4\" height=\"25px\" style=\"background: #20578d\">
			* only last ".$num_results." bans are shown out of ".$detectCount['total']." total logged detections *
			</td>
			</tr> 
			");	
		}
	else
		{
		if($detectCount['total'])
			{
			print("
				<tr>
				<td align=\"center\" colspan=\"4\" height=\"25px\" style=\"background: #20578d\">
				* there are 0 bans out of ".$detectCount['total']." total logged detections *
				</td>
				</tr> 
				");
			}
		else
			{
			print("
				<tr>
				<td align=\"center\" colspan=\"4\" height=\"25px\" style=\"background: #20578d\">
				* there are 0 logged detections *
				</td>
				</tr> 
				");
			}
		}
	

		
		//'Respawn Timer Bypass' & 'Undeployed MG-Reload' are omitted from this display 

include("footer.php");

?>